
checkTSforOCPrice <- function(TS) {
  if (!is.OC(TS)) {
    stop("TS Price series must contain Open and Close")
  }
  SAME <- Lag(Cl(TS)) == Op(TS)
  return (SAME)
}

checkGroupforPrice <- function(groupcode, method="OC", subset="") {
  groupinfo <- getDBGroup(groupcode)
  getCSPGroupPattern(groupcode)
  for (i in 1:dim(groupinfo)[1]) {
    TS <- get(paste(groupinfo[i,"code"],"vadb",sep="."))
    if (method=="OC") {
      chartSeries(checkTSforOCPrice(TS), name=groupinfo[i,"code"])
    } else if (method=="chart") {
      chartSeries(TS, subset=subset, name=groupinfo[i,"code"])
    }
  }
}